package com.twu.biblioteca;

import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

/**
 * Created by yiman on 6/23/14.
 */
public class CaptureCommand {
    public void capture(InputStream in,PrintStream out){
        Command command = new Command();
        Scanner keyboard = new Scanner((in));
        while(keyboard.hasNextLine()){
            String input = keyboard.nextLine();
            if(command.getResponse(input,in,out).equals("quit")){
                break;
            }
            else{
                if (!command.getResponse(input,in,out).equals("success"))
                    out.println(command.getResponse(input,in,out));
            }
        }
    }

    public void display(PrintStream out, String display){
        out.println(display);
    }
}
